package com.erpanderp.wam.ac.view.reimbursement;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.TimeZone;

import com.erpanderp.wam.ac.model.entity.reimbursement.Currency;
import com.erpanderp.wam.ac.model.entity.reimbursement.MiscExpense;
import com.erpanderp.wam.ac.model.entity.reimbursement.MiscExpenseDetails;
import com.erpanderp.wam.ac.model.service.reimbursement.MiscReimbursementDAO;
import com.erpanderp.wam.adm.model.entity.CustomLookup;
import com.erpanderp.wam.adm.model.entity.LookupValue;
import com.erpanderp.wam.adm.model.service.CustomLookupDAO;
import com.erpanderp.wam.usm.model.entity.user.Employee;
import com.erpanderp.wam.usm.model.entity.user.EmployeeAndReporting;
import com.erpanderp.wam.usm.model.entity.user.WAMUser;
import com.erpanderp.wam.usm.model.service.user.EmployeeAndReportingDAO;
import com.erpanderp.wam.usm.model.service.user.EmployeeDAO;
import com.erpanderp.wam.util.CommonLookup;
import com.erpanderp.wam.util.EmailUtil;
import com.erpanderp.wam.util.ValidationUtil;
import com.erpanderp.wam.util.WAMHostManager;

import javax.faces.application.FacesMessage;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import javax.swing.SwingWorker;

import org.primefaces.component.datatable.DataTable;
import org.primefaces.component.menubutton.MenuButton;
import org.primefaces.component.menuitem.MenuItem;
import org.primefaces.context.RequestContext;

@ManagedBean
@ViewScoped
public class CreateMiscReimbursementBean implements Serializable {
	
	private static final long serialVersionUID = 1L;
	HttpSession session = (HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(true);
	private WAMUser wamUser = (WAMUser) session.getAttribute(CommonLookup.SESSION_ATTRIBUTE_WAMUSER);
	HttpServletRequest request = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();
	ServletContext context = (ServletContext) FacesContext.getCurrentInstance().getExternalContext().getContext();
	private TimeZone timeZone = TimeZone.getDefault();
	
	boolean FORM_VALID;
	private boolean EXPENSE_ID_FORM_VALID;
	
	private Map<String,String> currencyMap = new HashMap<String, String>();
	private CustomLookup customLookUp = new CustomLookup();
	private CustomLookupDAO customLookupDAO = new CustomLookupDAO();
	private List<LookupValue> lookUpValuesList = new ArrayList<LookupValue>();
	private List<Currency> Currencies  =  new ArrayList<Currency>();
	

	private MiscExpense miscExpense = new MiscExpense();
	private Employee employee = new Employee();
	private MiscReimbursementDAO miscReimbursementDAO = new MiscReimbursementDAO();
	private boolean expenseIdSelection;
	private boolean viewMiscExpenseForm;
	private boolean createMiscExpenseForm;
	private boolean editMiscExpenseForm;
	private String selectedButton = CommonLookup.CREATE_MISC_BUTTON;
	private MenuButton selectedMenuButton = new MenuButton();
	
	private MiscExpenseDetails miscExpenseDetails = new MiscExpenseDetails();
	private List<MiscExpenseDetails> miscExpensesDetailsList = new ArrayList<MiscExpenseDetails>();
	private int sNo=1;
	
	private List<MiscExpense> miscExpenseList = new ArrayList<MiscExpense>();
	
	private List<MiscExpenseDetails> editableMiscExpensesDetails;
	private MiscExpense editableMiscExpense;
	private Map<String, String> miscFormIDSList = new HashMap<String, String>();
	EmailUtil emailUtil;
	String EMAIL_MESSAGE;
	private String selectedMiscFormId;
	private float totalINR;
	private float totalUSD;
	private String editableForm = null;
	private EmployeeAndReporting employeeAndReporting = new EmployeeAndReporting();
	private EmployeeAndReportingDAO employeeAndReportingDAO = new EmployeeAndReportingDAO();
	private EmployeeDAO employeeDAO = new EmployeeDAO();
	private Employee vicePresident;
	private boolean COLLECTOR_FORM_VALID;
	private DataTable assignedMiscExpenseDetailsList;
	//private TimeZone defaultTimeZone = TimeZone.getDefault();

	public CreateMiscReimbursementBean() {
		createMiscExpenseForm = true;
		//vicePresident = employeeAndReportingDAO.getEmployeeByDesignation(CommonLookup.DESIGNATION_VICE_PRESIDENT_VALUE);
		vicePresident = employeeDAO.getVP();
		
		selectedButton = CommonLookup.CREATE_MSIC_BUTTON;
		if (wamUser != null) {
			miscExpense.setEmployee(wamUser.getEmployee());
			miscExpense.setRequestDate(new Date());
			
			System.out.println("RAISED REQUESTS ARE " + miscExpenseList.size());
		} else {
			ValidationUtil.gotoLoginPage();
		}

		System.out.println("IN CREATE MISCREIMBURSEMENT CONSTRUCTOR");
		miscExpense.setMiscExpenseCode(CommonLookup.getAutoGeneratedMiscExpenseFormCode(wamUser.getEmployee().getEmployeeCode()));
		
		miscExpenseList =  miscReimbursementDAO.getMiscExpensesListByWAMUser(wamUser.getEmployee().getEmployeeId());
		for(MiscExpense miscExpense : miscExpenseList){
			miscExpense.setsNo(sNo);
			sNo++;
		}
		
		
		customLookUp = customLookupDAO.getCustomLookUp(CommonLookup.CURRENCY_CUSTOM_LOOKUP);
		lookUpValuesList = customLookupDAO.getLookupValuesList(customLookUp.getCustomLookId());
		for(LookupValue lookUpValue : lookUpValuesList){
			currencyMap.put(lookUpValue.getLookupName(), lookUpValue.getLookupValue());
		}
		
		viewMiscExpenseForm = false;
		editMiscExpenseForm = false;
		createMiscExpenseForm = true;
	}

	public String submitMiscExpense() {
		System.out.println("IN SUBMIT MISCEXPENSE");
		validate();
		if (FORM_VALID) {
			
			if (miscExpensesDetailsList.size() > 0) {
				
				miscExpense.setExpenseStatus(CommonLookup.MISC_INPROCESS_STATUS);
				miscExpense.getMiscExpensesDetails().addAll(miscExpensesDetailsList);
				miscExpense.setApprovedBy(vicePresident);
				
				miscExpense.setCreateDate(new Date());
				miscExpense.setStatus("ACTIVE");
				miscExpense.setCreatedBy(wamUser.getEmployee().getFirstName()+" "+wamUser.getEmployee().getLastName());
				
				miscReimbursementDAO.createMiscExpenseForm(miscExpense);

				 FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO,  " You have submitted successfully.", ""));
				
				
				//MAIL TRIGGERING CODE
				 System.out.println("AT CALLER METHOD: " + sendMessage());  //*******DONT REMOVE*******
					
					miscExpensesDetailsList.clear();
					Currencies.clear();	
					return "createmiscreimbursement";
					
			} else {
				System.out.println("EXPENSES ARE NOT ADDED");
				return null;
			}
			
		}
		return null;
	}
	
	 public void confirmationAction(ActionEvent e){
		 validate();
 		
 		if(FORM_VALID){
			RequestContext.getCurrentInstance().execute("confirmation.show();");
		}else{
			RequestContext.getCurrentInstance().execute("confirmation.hide();");
		}
    }	
	
	 //EDIT EXPENSE FORM 
	 public String editExpenseFormAction() {
		 System.out.println("=====INSIDE editExpenseFormAction() method=======");
	   try{
			  Map<String,String> params = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();
			  
			  String miscExpenseCode = params.get("miscExpenseCode");
			  
			  FacesContext.getCurrentInstance().getExternalContext().getRequestMap().put("miscExpenseCode", miscExpenseCode);
			  
			  FacesContext.getCurrentInstance().getExternalContext().redirect("/wam/ac/reimbursement/editmiscreimbursement.html?miscExpenseCode="+miscExpenseCode);
			  
			
		  }catch (Exception e) {
			  e.printStackTrace();
		 }
		 return "editmiscreimbursement";
	}
	 //View EXPENSE FORM 
	 public String viewExpenseFormAction() {
		 System.out.println("=====INSIDE viewExpenseFormAction() method======11=");
	   try{
			  Map<String,String> params = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();
			  
			  String miscExpenseCode = params.get("miscExpenseCode");
			  
			  FacesContext.getCurrentInstance().getExternalContext().getRequestMap().put("miscExpenseCode", miscExpenseCode);
			  
			  FacesContext.getCurrentInstance().getExternalContext().redirect("/wam/ac/reimbursement/viewmiscreimbursement.html?miscExpenseCode="+miscExpenseCode);
			 
			
		  }catch (Exception e) {
			  e.printStackTrace();
		 }
		 return "viewmiscreimbursement";
	}
	
	//SENDING EMAIL 
	public String sendMessage(){
				Map<String, String> hostsMap = WAMHostManager.getWAMHosts(context);
				String domainName = context.getInitParameter("domainName");
							
				
				String approverMail="movvasravani89@gmail.com";		
				//String approverMail = travelRequest.getApprover().getEmail();
			
				emailUtil = new EmailUtil();
				if (hostsMap.get(CommonLookup.DEV_EMAIL) == null) {					
					String[] to = { vicePresident.getEmail() };
					emailUtil.setRecieverAddresses(to);
				}else{
					
					String[] to = { hostsMap.get(CommonLookup.DEV_EMAIL) };
					System.out.println(to);
					emailUtil.setRecieverAddresses(to);
				}

				SimpleDateFormat sd=new SimpleDateFormat("dd-MMM-yyyy");
				String date=sd.format(new Date());
				
				String requestURL = "ac/reimbursement/approvereimbursement.html?miscCode="
						+ miscExpense.getMiscExpenseCode()
						+ "&empId="
						+ wamUser.getEmployee().getEmployeeId();
				String privateLink = "http://" + hostsMap.get(CommonLookup.PRIVATEHOST) + "/" + domainName + "/" + requestURL;
				String publicLink = "http://" + hostsMap.get(CommonLookup.PUBLICHOST) + "/"	+ domainName + "/" + requestURL;
				
				String messageString = "Dear  " + vicePresident.getFirstName()
						+ " " + vicePresident.getLastName() + ",<br /><br />" +

						"<h3>New Misc Expense Details</h3>"
						+ "<table style='border: 1px solid #d9d9d9;'>"
						+ "<tr> <td>Employee Code </td><td> : </td><td>"
						+ wamUser.getEmployee().getEmployeeCode()
						+ " </td></tr>"
						+ "<tr> <td>Employee Name</td><td> : </td> <td>"
						+ wamUser.getEmployee().getFirstName() + "  "+wamUser.getEmployee().getLastName()+"</td></tr>"
						+ "<tr> <td>Misc Expense Code</td><td> : </td> <td>"
						+ miscExpense.getMiscExpenseCode() + "</td></tr>"
						+ "<tr> <td>Request Date</td><td> : </td> <td>"+ date + "</td></tr>" +

						"</table><br/>"
						+ "<a style='color:#FF9933;font-weight: bold;' href=\""
						+ privateLink + "\">"
						+ "Please click here to approve/reject expense form"
						+ "</a /><br />"
						+ "(Employees who are in Hyderabad office)"
						+ "<br /><br />"
						+ "<a style='color:#FF9933;font-weight: bold;' href=\""
						+ publicLink + "\">"
						+ "Please click here to approve/reject expense form"
						+ "</a /><br />" + "(out side Hyderabad office)"
						+ "<br /><br />" +

						"Thanks & Regards, <br />"
						+ CommonLookup.WAM_DEVTEAM_SIGNATURE;
				;
				
				emailUtil.setMessage(messageString);
				emailUtil.setSenderEmail("podquick@erpanderp.com", "WAM - Dev Team");
				emailUtil.setSubject(wamUser.getEmployee().getFirstName()+" "+wamUser.getEmployee().getLastName() +"( "+miscExpense.getMiscExpenseCode()+" ) -Misc. Expense Request");
				
				SwingWorker worker = new SwingWorker<String, Object>() {
					@Override
					protected String doInBackground() throws Exception {
						EMAIL_MESSAGE = emailUtil.processAndSendEmail();
						return null;
					}

					@Override
					protected void done() {
							System.out.println("DONE " + EMAIL_MESSAGE);		
					}
				};
				worker.execute();
				System.out.println( "BEFORE RETURNING: " + EMAIL_MESSAGE);
				return EMAIL_MESSAGE;
			}

	public void updateMiscExpense() {
		System.out.println("IN UPDATE MISC EXPENSE");

		editableMiscExpense.setDateModified(new Date());
		editableMiscExpense.getMiscExpensesDetails().addAll(
				editableMiscExpensesDetails);
		miscReimbursementDAO.updateMiscExpenseForm(editableMiscExpense);
		FacesMessage msg = new FacesMessage(
				"Miscellaneous reimbursement form updated Successful", null);
		FacesContext.getCurrentInstance().addMessage(null, msg);

	}

	public void addMiscExpenseDetailsAction() {
		
		validateCollector();
		if (COLLECTOR_FORM_VALID) {
			
			try{
				//miscExpenseDetails.setEmployee(employee);
				miscExpenseDetails.setCreateDate(new Date());
				miscExpenseDetails.setCreatedBy(CommonLookup.CREATEDBY_DEVELOPER_TEXT);
				miscExpenseDetails.setStatus(CommonLookup.STATUS_ACTIVE);
					
				miscExpensesDetailsList.add(miscExpenseDetails); //ALL RECORDS LIST
				totalAmountandCurrencyListAction(miscExpenseDetails.getCurrency(),miscExpenseDetails.getAmount());
				
				miscExpenseDetails = new MiscExpenseDetails();
			
			}catch (Exception e) {
				e.printStackTrace();
			}		
		}
	}
	
	
	//ADDIGN CURRENCY TOTALS
		public void totalAmountandCurrencyListAction(String curncy,Float amt) {	 		
			try{
					boolean MATCHED = false;
					for(LookupValue currency : lookUpValuesList){					
						if(curncy.equals(currency.getLookupValue())){
							MATCHED = true;
							boolean ADDED = false;						
							for(Currency cur : Currencies){
								if(currency.getLookupValue().equals(cur.getCurrency())){
									ADDED = true;
									//change the value
									cur.setAmount(amt+ cur.getAmount());								
									break;
								}
							}						
							if(!ADDED ){
								//create new currentcy and add to the list
								Currency currencyObj = new Currency();
								currencyObj.setAmount(amt);
								currencyObj.setCurrency(curncy);
								Currencies.add(currencyObj);
							}						
							break;				
						}					
					}					
			 }catch (Exception e1) {
					e1.printStackTrace();
				}		
		}
		
	public void subtractTotalAmount(String curncy,Float amt) {	 		
			try{				
					for(LookupValue currency : lookUpValuesList){
						if(curncy.equals(currency.getLookupValue())){						
							for(Currency cur : Currencies){
								if(currency.getLookupValue().equals(cur.getCurrency())){								
									//change the value
									cur.setAmount(cur.getAmount() - amt);	
								}
							}										
						}					
					}					
				 }catch (Exception e1) {
						e1.printStackTrace();
				  }		
			}

	public void removeMiscExpensesDetails(ActionEvent e) {
		MiscExpenseDetails selectedMiscExpenseDetails = (MiscExpenseDetails) assignedMiscExpenseDetailsList.getRowData();
		subtractTotalAmount(selectedMiscExpenseDetails.getCurrency(),selectedMiscExpenseDetails.getAmount());
		miscExpensesDetailsList.remove(selectedMiscExpenseDetails);
	}

	public void serachMiscExpense() {
		System.out.println("IN SEARCH MISC EXPENSE");

		editableMiscExpensesDetails = new ArrayList<MiscExpenseDetails>();
		validateExpenseId();
		if (EXPENSE_ID_FORM_VALID) {
			editableMiscExpense = miscReimbursementDAO.getMiscExpense(
					selectedMiscFormId, wamUser.getEmployee().getEmployeeId());

			if (editableMiscExpense != null) {
				editableMiscExpensesDetails.addAll(editableMiscExpense
						.getMiscExpensesDetails());
				System.out.println("FROM DAO METHOD MISC EXPENSE CODE IS"
						+ editableMiscExpense.getMiscExpenseCode());

				viewMiscExpenseForm = true;
			} else {
				viewMiscExpenseForm = false;
				editableForm = CommonLookup.MSIC_NOT_EDITABLE_FORM;
				System.out.println("MSIC EXPENSE FORM IS UNABLE TO FIND");
			}
		} else {
			viewMiscExpenseForm = false;
		}
	}

	public void buttonChangeListner(ActionEvent e) {
		selectedButton = (((MenuItem)e.getComponent()).getValue().toString());
		if (selectedButton.equals(CommonLookup.VIEWUPDATE_MISC_BUTTON)) {

			viewMiscExpenseForm = false;
			createMiscExpenseForm = false;
			editMiscExpenseForm = true;
			// selectedButton = CommonLookup.EDIT_MSIC_BUTTON;
			System.out.println("EDIT BUTTON SELECTED");
		} else {

			viewMiscExpenseForm = false;
			editMiscExpenseForm = false;
			createMiscExpenseForm = true;
			// selectedButton = CommonLookup.VIEW_PRINT_MSIC_BUTTON;
			System.out.println("CREATE BUTTON SELECTED");
		}

	}

	public void removeFromList() {
		System.out.println("IN REMOVE METHOD");

	}

	public void validate() {
		System.out.println("IN VALIDATE METHOD");
		
		FORM_VALID = true;
		if (ValidationUtil.isEmpty(miscExpense.getExpensePurpose(),
				"Purpose of expense", null, FacesContext.getCurrentInstance()) != null) {
			FORM_VALID = false;
		}
		if (ValidationUtil.isEmpty(miscExpense.getExpenseLocation(),
				"Location", null, FacesContext.getCurrentInstance()) != null) {
			FORM_VALID = false;
		}
		
				
		if (miscExpensesDetailsList.size() == 0) {
			FORM_VALID = false;
			FacesContext.getCurrentInstance().addMessage(
					null,
					new FacesMessage(FacesMessage.SEVERITY_WARN,
							" Expense details can not be empty.", ""));
		}
		if(miscExpense.getAdvanceTakenAmount() < 0){
			FORM_VALID = false;
			FacesContext.getCurrentInstance().addMessage(null,new FacesMessage(FacesMessage.SEVERITY_WARN,"Advance taken amount should be grater than zero.", ""));
			miscExpense.setAdvanceTakenAmount(0.0f);
		}
		if(miscExpense.getAdvanceTakenAmount() > 0){			
			if (ValidationUtil.isEmpty(miscExpense.getAdvanceTakenCurrency(),
					"Advance Taken Currency", null, FacesContext.getCurrentInstance()) != null) {
				FORM_VALID = false;
			}			
		}

	}

	public void validateCollector() {
		COLLECTOR_FORM_VALID = true;
		if (ValidationUtil.isEmpty(
				miscExpenseDetails.getBillDate() != null ? miscExpenseDetails
						.getBillDate().toString() : null, "Bill date", null,
				FacesContext.getCurrentInstance()) != null) {
			COLLECTOR_FORM_VALID = false;
		}
		if (ValidationUtil.isEmpty(miscExpenseDetails.getBillDesc(),
				"Bill description", null, FacesContext.getCurrentInstance()) != null) {
			COLLECTOR_FORM_VALID = false;
		}
				
		if(miscExpenseDetails.getAmount() == 0){
			COLLECTOR_FORM_VALID = false;
			FacesContext.getCurrentInstance().addMessage(null,new FacesMessage(FacesMessage.SEVERITY_WARN,"Expense amount should not zero.", ""));
		}
		
		if(miscExpenseDetails.getAmount() < 0){
			COLLECTOR_FORM_VALID = false;
			FacesContext.getCurrentInstance().addMessage(null,new FacesMessage(FacesMessage.SEVERITY_WARN,"Expense amount should be grater than zero.", ""));
			miscExpenseDetails.setAmount(0.0f);
		}	

	}

	public void validateExpenseId() {
		System.out.println("IN VALIDATE EXPENSE ID");
		EXPENSE_ID_FORM_VALID = true;
		if (ValidationUtil.isEmpty(
				(selectedMiscFormId != null) ? selectedMiscFormId : null,
				"Expense Id", null, FacesContext.getCurrentInstance()) != null) {
			FORM_VALID = false;
		}
	}

	//REST BUTTON ACTIONS
	public void resetMiscExpenseDetailsAction(ActionEvent ae) {
		miscExpenseDetails.setBillDate(null);
		miscExpenseDetails.setBillDesc("");
		miscExpenseDetails.setBillNo("");
		miscExpenseDetails.setAmount(0.0f);
	}
	

	public MiscExpenseDetails getMiscExpenseDetails() {
		return miscExpenseDetails;
	}

	public void setMiscExpenseDetails(MiscExpenseDetails miscExpenseDetails) {
		this.miscExpenseDetails = miscExpenseDetails;
	}

	public WAMUser getWamUser() {
		return wamUser;
	}

	public void setWamUser(WAMUser wamUser) {
		this.wamUser = wamUser;
	}

	public boolean isFORM_VALID() {
		return FORM_VALID;
	}

	public void setFORM_VALID(boolean fORM_VALID) {
		FORM_VALID = fORM_VALID;
	}

	public MiscExpense getMiscExpense() {
		return miscExpense;
	}

	public void setMiscExpense(MiscExpense miscExpense) {
		this.miscExpense = miscExpense;
	}

	public Employee getEmployee() {
		return employee;
	}

	public void setEmployee(Employee employee) {
		this.employee = employee;
	}

	public MiscReimbursementDAO getMiscReimbursementDAO() {
		return miscReimbursementDAO;
	}

	public void setMiscReimbursementDAO(
			MiscReimbursementDAO miscReimbursementDAO) {
		this.miscReimbursementDAO = miscReimbursementDAO;
	}

	public boolean isExpenseIdSelection() {
		return expenseIdSelection;
	}

	public void setExpenseIdSelection(boolean expenseIdSelection) {
		this.expenseIdSelection = expenseIdSelection;
	}

	public boolean isViewMiscExpenseForm() {
		return viewMiscExpenseForm;
	}

	public void setViewMiscExpenseForm(boolean viewMiscExpenseForm) {
		this.viewMiscExpenseForm = viewMiscExpenseForm;
	}

	public String getSelectedButton() {
		return selectedButton;
	}

	public void setSelectedButton(String selectedButton) {
		this.selectedButton = selectedButton;
	}

	public boolean isCreateMiscExpenseForm() {
		return createMiscExpenseForm;
	}

	public void setCreateMiscExpenseForm(boolean createMiscExpenseForm) {
		this.createMiscExpenseForm = createMiscExpenseForm;
	}

	public boolean isEditMiscExpenseForm() {
		return editMiscExpenseForm;
	}

	public void setEditMiscExpenseForm(boolean editMiscExpenseForm) {
		this.editMiscExpenseForm = editMiscExpenseForm;
	}

	public float getTotalINR() {
		return totalINR;
	}

	public void setTotalINR(float totalINR) {
		this.totalINR = totalINR;
	}

	public float getTotalUSD() {
		return totalUSD;
	}

	public void setTotalUSD(float totalUSD) {
		this.totalUSD = totalUSD;
	}

	public List<MiscExpense> getMiscExpenseList() {
		return miscExpenseList;
	}

	public void setMiscExpenseList(List<MiscExpense> miscExpenseList) {
		this.miscExpenseList = miscExpenseList;
	}

	public Map<String, String> getMiscFormIDSList() {
		return miscFormIDSList;
	}

	public void setMiscFormIDSList(Map<String, String> miscFormIDSList) {
		this.miscFormIDSList = miscFormIDSList;
	}

	public String getSelectedMiscFormId() {
		return selectedMiscFormId;
	}

	public void setSelectedMiscFormId(String selectedMiscFormId) {
		this.selectedMiscFormId = selectedMiscFormId;
	}

	public String getEditableForm() {
		return editableForm;
	}

	public void setEditableForm(String editableForm) {
		this.editableForm = editableForm;
	}

	public boolean isEXPENSE_ID_FORM_VALID() {
		return EXPENSE_ID_FORM_VALID;
	}

	public void setEXPENSE_ID_FORM_VALID(boolean eXPENSE_ID_FORM_VALID) {
		EXPENSE_ID_FORM_VALID = eXPENSE_ID_FORM_VALID;
	}

	public List<MiscExpenseDetails> getEditableMiscExpensesDetails() {
		return editableMiscExpensesDetails;
	}

	public void setEditableMiscExpensesDetails(
			List<MiscExpenseDetails> editableMiscExpensesDetails) {
		this.editableMiscExpensesDetails = editableMiscExpensesDetails;
	}

	public MiscExpense getEditableMiscExpense() {
		return editableMiscExpense;
	}

	public void setEditableMiscExpense(MiscExpense editableMiscExpense) {
		this.editableMiscExpense = editableMiscExpense;
	}

	public EmployeeAndReporting getEmployeeAndReporting() {
		return employeeAndReporting;
	}

	public void setEmployeeAndReporting(
			EmployeeAndReporting employeeAndReporting) {
		this.employeeAndReporting = employeeAndReporting;
	}

	public Employee getVicePresident() {
		return vicePresident;
	}

	public void setVicePresident(Employee vicePresident) {
		this.vicePresident = vicePresident;
	}

	public boolean isCOLLECTOR_FORM_VALID() {
		return COLLECTOR_FORM_VALID;
	}

	public void setCOLLECTOR_FORM_VALID(boolean cOLLECTOR_FORM_VALID) {
		COLLECTOR_FORM_VALID = cOLLECTOR_FORM_VALID;
	}

	public DataTable getAssignedMiscExpenseDetailsList() {
		return assignedMiscExpenseDetailsList;
	}

	public void setAssignedMiscExpenseDetailsList(
			DataTable assignedMiscExpenseDetailsList) {
		this.assignedMiscExpenseDetailsList = assignedMiscExpenseDetailsList;
	}

	

	public Map<String,String> getCurrencyMap() {
		return currencyMap;
	}

	public void setCurrencyMap(Map<String,String> currencyMap) {
		this.currencyMap = currencyMap;
	}

	public List<MiscExpenseDetails> getMiscExpensesDetailsList() {
		return miscExpensesDetailsList;
	}

	public void setMiscExpensesDetailsList(List<MiscExpenseDetails> miscExpensesDetailsList) {
		this.miscExpensesDetailsList = miscExpensesDetailsList;
	}

	public List<Currency> getCurrencies() {
		return Currencies;
	}

	public void setCurrencies(List<Currency> currencies) {
		Currencies = currencies;
	}

	public int getsNo() {
		return sNo;
	}

	public void setsNo(int sNo) {
		this.sNo = sNo;
	}

	public MenuButton getSelectedMenuButton() {
		return selectedMenuButton;
	}

	public void setSelectedMenuButton(MenuButton selectedMenuButton) {
		this.selectedMenuButton = selectedMenuButton;
	}

	public EmployeeAndReportingDAO getEmployeeAndReportingDAO() {
		return employeeAndReportingDAO;
	}

	public void setEmployeeAndReportingDAO(EmployeeAndReportingDAO employeeAndReportingDAO) {
		this.employeeAndReportingDAO = employeeAndReportingDAO;
	}

	public TimeZone getTimeZone() {
		return timeZone;
	}

	public void setTimeZone(TimeZone timeZone) {
		this.timeZone = timeZone;
	}

	

}
